<!-- 父组件 -->
<template>
    <div>
        <p>Count: {{ num }}</p>
        <child-component :num="num" @update:count="updateCount"></child-component>
    </div>
</template>

<script>
import ChildComponent from '@/components/Child.vue'

export default {
    components: {ChildComponent},
    data() {
        return {
            num: 0
        }
    },
    methods: {
        updateCount(newCount) {
            this.num = newCount
        }
    }
}
</script>